<?php
$page_title = "测试专用";
$style = "../css/main.css";
$page_id = "page_sandbox";
$hasside = 0;
require "../include/header.php";
require "class_image.php";
?>
<div class="mainwrap"><div class="mainwrap-inner">

例子１：缩小图像后直接输出至浏览器<br/>
<?php
/*
$obj = new ReSizeImage(); 
$obj->setSourceFile('./temp/big.png'); 
$obj->saveFile(false); 
$obj->setWidth(250); 
$obj->setHeight(250); 
echo "test";
echo "<img src=\"".$obj->draw()."\">"; 
*/
?>
<hr/>

例子２：缩小图像后保存新图像文件为“new.png” 
<?php
try { 
	$obj = new ReSizeImage(); 
	$obj->setSourceFile('.temp/big.png'); 
	$obj->setDstFile('.temp/small.png'); 
	$obj->setWidth(150); 
	$obj->setHeight(150); 
	$obj->draw(); 
	echo "<div style=\"color:#080;\">缩略图已经生成！</div>";
} catch (Exception $ex) { 
	echo $ex; 
}
?>
<hr/>

例子３：缩小图像后保存新图像文件为“new.jpg”，并设置其quality值为“100” 
<?php
/*
$obj = new ReSizeImage(); 
$obj->setSourceFile('win.png'); 
$obj->setDstFile('new.jpg'); 
$obj->setWidth(250); 
$obj->setHeight(250); 
$obj->draw(100); 
*/
?>
<hr/>

例子４：捕捉程序中的异常 
<?php
/*
try { 
$obj = new ReSizeImage(); 
$obj->setSourceFile('no.png'); 
$obj->saveFile(false); 
$obj->setWidth(250); 
$obj->setHeight(250); 
$obj->draw(); 
} catch (Exception $ex) { 
echo $ex; 
}
*/
?>
<hr/>

</div></div>
<div class="sidewrap"><div class="sidewrap-inner">
<?php
require "sidebar.php";
?>
</div></div>


<?php
require "footer.php";
?>
